package com.pansky.crm.controller.system;

import com.pansky.crm.annotation.OperateLog;
import com.pansky.crm.common.mybatisplus.ApiResult;
import com.pansky.crm.common.mybatisplus.ResultPageDto;
import com.pansky.crm.entity.bo.page.UserLoginLogPageBo;
import com.pansky.crm.service.UserLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：zhouzhiyong
 * @date ：Created in 2021/3/1 15:10
 * @description：登陆日志
 */
@RestController
@Api(tags = {"管理端-用户登录日志"})
@OperateLog
@RequestMapping("/userLoginLog")
public class UserLoginLogController {

    @Autowired
    private UserLoginLogService userLoginLogService;

    @ApiOperation(value = "分页查询用户登录日志", notes = "分页查询用户登录日志")
    @PostMapping("/page/query")
    public ApiResult<ResultPageDto> queryByPage(@RequestBody UserLoginLogPageBo queryDTO) {
        return userLoginLogService.queryByPage(queryDTO);
    }

    @ApiOperation(value = "删除用户登录日志", notes = "@author yandanyang")
    @GetMapping("/delete")
    public ApiResult<Boolean> delete(@RequestParam Integer id) {
        return ApiResult.ok(userLoginLogService.removeById(id));
    }

//    @ApiOperation(value = "查询员工在线状态", notes = "@author zzr")
//    @PostMapping("/userOnLine/query")
//    public ApiResult<PageResultDTO<EmployeeVO>> queryUserOnLine(@RequestBody @Valid EmployeeQueryDTO queryDTO) {
//        return userLoginLogService.queryUserOnLine(queryDTO);
//    }

}
